from __future__ import absolute_import, unicode_literals

from celery import Celery
# from watcher import ModuleWatcher

app = Celery('paralib',
             broker='redis://127.0.0.1:6379/0',
             backend='redis://127.0.0.1:6379/1',
             include=['paralib.tasks'])

# Optional configuration, see the application user guide.
app.conf.update(
    result_expires=3600,
    task_serializer='pickle',
    result_serializer='pickle',
    accept_content=['pickle'],
)
#
# print('start called')
# moduleWatcher = ModuleWatcher()
# watcherList = [
#     'paralib'
# ]
# for module in watcherList:
#     moduleWatcher.watch_module(module)
# moduleWatcher.start_watching()

if __name__ == '__main__':
    app.start()